package src.lab03.test01;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by 12442 on 2017/11/16.
 */
public class Test01 {
    public static void main(String[] args) throws IOException {
        //写文件-字符流
        BufferedWriter writer=null;
        try {
            String path = "D:\\hello.text";
            writer = new BufferedWriter(new FileWriter(path));

            writer.write("hello,world!");
            writer.newLine();

            writer.write("020101100222");
            writer.newLine();

            writer.write("bye!!!!");
        }catch (IOException e){
           e.printStackTrace();
        }finally {
            try {
                writer.close();
            } catch (IOException e){
                e.printStackTrace();
            }
        }
    }
}
